package com.yenlien.traceyun.control.dao;

import com.yenlien.traceyun.control.entity.LevelSecond;
import com.yenlien.traceyun.webase.dao.BaseJpaDao;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface LevelSecondDao extends BaseJpaDao<LevelSecond> {

    @Query(value = "select id,name,create_time,top_id from t_level_second where top_id=?1", nativeQuery = true)
    List<LevelSecond> findByTopId(String topId);

    @Query(value = "select id,name,create_time,top_id from t_level_second where name=?1", nativeQuery = true)
    LevelSecond findBySecondName(String name);

    @Query(value = "select id,name,create_time,top_id from t_level_second where id=?1", nativeQuery = true)
    LevelSecond findById(String id);
}
